package util;

import java.util.ArrayList;
import java.util.Scanner;

import model.Course;
import model.Student;
/**
 * 打印学生列表
 * @author k51
 *
 */
public class PrintUtil {
	public static void display(ArrayList<Student> studentList) {
		if(studentList.size()==0||studentList==null) {
			System.out.println("表里没有数据!");
			return;
		}
        // 展开结果集数据库
        System.out.println("ID      姓名            性别           年龄          班级                  专业");
		for(int i=0;i<studentList.size();i++) {
            // 输出数据
            Student student = studentList.get(i);
            
           System.out.print(student.getId()+"   ");
           System.out.print(student.getName()+"     ");
           System.out.print(student.getGender()+"        ");
           System.out.print(student.getAge()+"       ");           
           System.out.print(student.getClassname()+"     ");
           System.out.print(student.getMajorName());
           System.out.print("\n");
		}
	}
	/**
	 * 打印菜单
	 */
    public static void showMenu() {
    System.out.println("------------------------------");
    System.out.println("------请输入你选择的序号------");
    System.out.println("---1.查看学生表数据-----------");
    System.out.println("---2.添加学生信息-------------");
    System.out.println("---3.删除学生信息-------------");
    System.out.println("---4.更新学生信息-------------");
    System.out.println("---5.选课---------------------");
    System.out.println("---6.退出程序-----------------");
    }

/**
 * 打印选修课程
 */
    public static void printCourse(ArrayList<Course> courseList) {
    	if(courseList == null || courseList.size()==0) {
    		System.out.println("课程表位空");
    		return;
    	}
    	System.out.println("课程ID       课程名");
    	for(int i = 0; i<courseList.size();i++) {
    		Course course = courseList.get(i);
    	System.out.print(course.getCourseId()+"    ");
    	System.out.print(course.getCourseName()+"    ");
    	System.out.print("\n");
    }
    }
}
